package com.motos;

public final class Truck extends Moto {
    private int ton;
    public Truck(){}
    public Truck(String no, String color ,int ton) {
        this.ton = ton;
        this.setNo(no);
        this.setColor(color);
        if (ton<=10) {
            this.setPrice(500);
        }
        else if (ton>10&&ton<=20) {
            this.setPrice(1000);
        }
        else this.setPrice(1500);
    }

    public int getTon() {
        return ton;
    }

    public void setTon(int ton) {
        this.ton = ton;
    }
    public double calcRent(int days){
        return getPrice()*days;
    }

    @Override
    public String toString() {
        return this.getNo()+"\t"+this.getTon()+"\t"+this.getColor()+"\t"+this.getPrice();
    }
}
